home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Herra / TIMWIN.ZIP / VSHRP.CMD < prev    next >
OS/2 REXX Batch file  |  1993-09-22  |  1KB  |  47 lines

  1. ;VSHRP   --  Algorithm for non linear sharpening  (P.Verbeek, TU-Delft)
  2. ;syntax:     *vshrp #       (# = window size)
  3. ;expects:    source image in a
  4. ;result:     image in p or h, depending on configuration
  5. ;uses:       images q, r, s
  6. ;****************************** 
  7. parms
  8. int wsize = 3
  9. endparms
  10.  
  11. IMAGE img
  12.  
  13. if wsize == 0 wsize = 3              ;                   -----
  14.  
  15. if (((improp fg) & DIS_BIT) == DIS_BIT)
  16.   img = "p"
  17. else
  18.   img = "h"
  19. endif
  20.  
  21. dest img
  22. show img
  23.  
  24.               ;                 /
  25. dis a         ;org -->    ____/    ___
  26. dis q         ;                   /
  27. min p wsize   ;min -->    ______/
  28. ;unif wsize   ;                __
  29. sub img q     ;org - min   ___/  \__  (p)
  30.               ;                ___
  31. dest r        ;               /
  32. max img wsize ;max -->   ___/
  33. ;unif wsize   ;              __
  34. sub r img     ;max - org ___/  \__    (r)
  35. dest s        ;                _____
  36. comp q > r    ;binary     _____
  37. dis r
  38. and r s       ;           _____\___
  39. dest s        ;           _____
  40. inv           ;                ____
  41. dest q        ;
  42. and q s       ;           ____/____
  43. dest img
  44. sub img q
  45. add r img
  46. stop
  47.